<template>
	<div id="app" style="">
		<router-view />
	</div>
</template>
<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			saveState() {
				sessionStorage.setItem("state", JSON.stringify(this.$store.state));
			}
		},
		created() {
			//向window添加unload事件
			window.addEventListener("unload", this.saveState);
		}
	}
</script>
<style lang="scss" scoped></style>
